<template>
  <div>
    <h1>Hi，{{ userInfo.username }} ，睡得着么？</h1>
  </div>
</template>

<script>
export default {
  name: "Index",
  data() {
    return {
      userInfo: {
        id: "",
        username: "",
        avatar: ""
      }
    }
  },
  created() {
    this.getUserInfo()
  },
  methods: {
    getUserInfo() {
      this.$axios.get("/sys/userInfo").then(res => {
        this.userInfo = res.data.data
      })
    }
  }
}
</script>

<style scoped>
.el-header {
  background-color: #17B3A3;
  color: #333;
  text-align: center;
  line-height: 60px;
}
</style>